addpath('functions\')
ComprehensiveStudy_varyingEstimates;

FileNames = {'output\ComprehensiveStudy_6AAllVarying_030through060','output\ComprehensiveStudy_6BAllVarying_030through060','output\ComprehensiveStudy_6CAllVarying_030through060','output\ComprehensiveStudy_6EAllVarying_030through060','output\ComprehensiveStudy_6JAllVarying_030through060','output\ComprehensiveStudy_6SAllVarying_030through060'};
valsForSumStats = zeros(2,6);
coeffs = zeros(315,6*13);
stErrors = zeros(315,6*13);
counter = 0;
while(counter<5)
    counter = counter+1; 
    load(FileNames{1,counter},'betasExtrasMech05d');
    coeffs(:,(1:13)+(counter-1)*13) = betasExtrasMech05d(:,(2:2:26));
    load(FileNames{1,counter},'stErExtrasMech05d');
    stErrors(:,(1:13)+(counter-1)*13) = stErExtrasMech05d(:,(2:2:26));
end
load(FileNames{1,5},'DatesForLater');
datesExtras = zeros(300,1);
counter = 0;
pointer = 1;
while(counter<6)
counter = counter +1;
lengthdates = size(DatesForLater{counter,1},1);
datesExtras(pointer:pointer+lengthdates-1,:) = DatesForLater{counter,1};
pointer = pointer + lengthdates;
end
datesExtras = datesExtras(1:pointer-1,:);

selectorNonHolidays = zeros(315,1)+1;
selectorNonHolidays([8 63 127 192 257 311:315],:) = 0;
selectorNonHolidays = (selectorNonHolidays>0);
formatOut = 'mm/dd/yy';
dateVec = datestr(datesExtras+1,formatOut);

coeffs = coeffs(selectorNonHolidays,:);
stErrors = stErrors(selectorNonHolidays,:);

oldFolder = cd('..');
save('intermediate\MicrostructureEstimatesAndOutputVaryingBetas');
cd(oldFolder)